package org.springframework.beans.extend;

import org.springframework.beans.factory.parsing.EmptyReaderEventListener;
import org.springframework.beans.factory.parsing.FailFastProblemReporter;
import org.springframework.beans.factory.parsing.NullSourceExtractor;
import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.beans.factory.xml.XmlReaderContext;
import org.springframework.core.io.Resource;
import org.springframework.util.ClassUtils;

public class MyXmlReaderContext extends XmlReaderContext {


	private   XmlBeanDefinitionReader reader ;

	public XmlBeanDefinitionReader getReader() {
		return reader;
	}

	private Resource resource ;

	public Resource getResource() {
		return resource;
	}




	public MyXmlReaderContext( XmlBeanDefinitionReader reader
			,Resource resource){

		super(resource,
				new FailFastProblemReporter(),
				new EmptyReaderEventListener(),
				new NullSourceExtractor(),
				reader,
				new DefaultNamespaceHandlerResolver(
				ClassUtils.getDefaultClassLoader())
		);
		this.reader=reader;
		this.resource=resource;
	}
}
